Introduction

In this part we will look at a few extensions of the model and the effect of different world topologies.

Agents can now be immune and dead as well.

Extension 1 - immunity

For the first extension I let infected agents become immune instead of susceptible again with a certain rate.

We are including a second file here. It contains the visualisation code from the previous notebook as a function.

For convenience I have put the visualisation code into a function.

Extension 2 - mortality

Now we also assume that the infected people can die. As we can see in the code immunity and death are formally identical as in both cases the individual is removed from the simulation.

Extension 3 - topology

Now, instead of a regular grid, we place the agent on an irregular graph. The algorithm is called a random geometric graph and was used as one of the first (very simple) models of transport networks.

The function is declared as follows:

function setup_geograph(n = 2500, near = 0.05, rand_cont = 0)

with number of nodes n, threshold to connect nodes near (don't set this much higher or it might crash your browser) and number of additional random connections rand_cont (the latter is not part of the original RGG).

Things to try